home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Interfaces / Universal Interfaces 2.0a3 / Universal AIncludes / Video.a < prev    next >
Encoding:
Text File  |  1994-11-11  |  14.6 KB  |  342 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Video.a
  3. ;
  4. ;    Copyright:    © 1984-1994 by Apple Computer, Inc.
  5. ;                All rights reserved.
  6. ;
  7. ;    Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8. ;
  9. ;    Bugs?:        If you find a problem with this file, send the file and version
  10. ;                information (from above) and the problem description to:
  11. ;
  12. ;                    Internet:    apple.bugs@applelink.apple.com
  13. ;                    AppleLink:    APPLE.BUGS
  14. ;
  15. ;
  16.  
  17.     IF &TYPE('__VIDEO__') = 'UNDEFINED' THEN
  18. __VIDEO__ SET 1
  19.  
  20.  
  21.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  22.     include 'Quickdraw.a'
  23.     ENDIF
  24. ;        include 'Types.a'                                            ;
  25. ;            include 'ConditionalMacros.a'                            ;
  26. ;        include 'MixedMode.a'                                        ;
  27. ;        include 'QuickdrawText.a'                                    ;
  28.  
  29. mBaseOffset                        EQU        1                    ;Id of mBaseOffset.
  30. mRowBytes                        EQU        2                    ;Video sResource parameter Id's 
  31. mBounds                            EQU        3                    ;Video sResource parameter Id's 
  32. mVersion                        EQU        4                    ;Video sResource parameter Id's 
  33. mHRes                            EQU        5                    ;Video sResource parameter Id's 
  34. mVRes                            EQU        6                    ;Video sResource parameter Id's 
  35. mPixelType                        EQU        7                    ;Video sResource parameter Id's 
  36. mPixelSize                        EQU        8                    ;Video sResource parameter Id's 
  37. mCmpCount                        EQU        9                    ;Video sResource parameter Id's 
  38. mCmpSize                        EQU        10                    ;Video sResource parameter Id's 
  39. mPlaneBytes                        EQU        11                    ;Video sResource parameter Id's 
  40. mVertRefRate                    EQU        14                    ;Video sResource parameter Id's 
  41. mVidParams                        EQU        1                    ;Video parameter block id.
  42. mTable                            EQU        2                    ;Offset to the table.
  43. mPageCnt                        EQU        3                    ;Number of pages
  44. mDevType                        EQU        4                    ;Device Type
  45. oneBitMode                        EQU        128                    ;Id of OneBitMode Parameter list.
  46. twoBitMode                        EQU        129                    ;Id of TwoBitMode Parameter list.
  47. fourBitMode                        EQU        130                    ;Id of FourBitMode Parameter list.
  48. eightBitMode                    EQU        131                    ;Id of EightBitMode Parameter list.
  49.  
  50. sixteenBitMode                    EQU        132                    ;Id of SixteenBitMode Parameter list.
  51. thirtyTwoBitMode                EQU        133                    ;Id of ThirtyTwoBitMode Parameter list.
  52. firstVidMode                    EQU        128                    ;The new, better way to do the above. 
  53. secondVidMode                    EQU        129                    ; QuickDraw only supports six video 
  54. thirdVidMode                    EQU        130                    ; at this time.      
  55. fourthVidMode                    EQU        131
  56. fifthVidMode                    EQU        132
  57. sixthVidMode                    EQU        133
  58. spGammaDir                        EQU        64
  59. spVidNamesDir                    EQU        65
  60.  
  61. ; csTimingFormat values in VDTimingInfo 
  62. ; look in the declaration rom for timing info 
  63. kDeclROMtables                    EQU        'decl'
  64.  
  65. ; Timing mode constants for Display Manager MultiMode support
  66. ;    Corresponding    .h equates are in Video.h
  67. ;                    .a equates are in Video.a
  68. ;                    .r equates are in DepVideoEqu.r
  69. ;
  70. timingInvalid                    EQU        0                    ; Unknown timing… force user to confirm.
  71. timingApple12                    EQU        130                    ;  512x384 (60 Hz) Rubik timing.
  72. timingApple12x                    EQU        135                    ;  560x384 (60 Hz) Rubik-560 timing.
  73. timingApple13                    EQU        140                    ;  640x480 (67 Hz) HR timing.
  74. timingApple13x                    EQU        145                    ;  640x400 (67 Hz) HR-400 timing.
  75. timingAppleVGA                    EQU        150                    ;  640x480 (60 Hz) VGA timing.
  76. timingApple15                    EQU        160                    ;  640x870 (75 Hz) FPD timing.
  77. timingApple15x                    EQU        165                    ;  640x818 (75 Hz) FPD-818 timing.
  78. timingApple16                    EQU        170                    ;  832x624 (75 Hz) GoldFish timing.
  79. timingAppleSVGA                    EQU        180                    ;  800x600 (56 Hz) SVGA timing.
  80. timingApple1Ka                    EQU        190                    ; 1024x768 (60 Hz) VESA 1K-60Hz timing.
  81. timingApple1Kb                    EQU        200                    ; 1024x768 (70 Hz) VESA 1K-70Hz timing.
  82. timingApple19                    EQU        210                    ; 1024x768 (75 Hz) Apple 19" RGB.
  83. timingApple21                    EQU        220                    ; 1152x870 (75 Hz) Apple 21" RGB.
  84. timingAppleNTSC_ST                EQU        230                    ;  512x384 (60 Hz, interlaced, non-convolved).
  85. timingAppleNTSC_FF                EQU        232                    ;  640x480 (60 Hz, interlaced, non-convolved).
  86. timingAppleNTSC_STconv            EQU        234                    ;  512x384 (60 Hz, interlaced, convolved).
  87. timingAppleNTSC_FFconv            EQU        236                    ;  640x480 (60 Hz, interlaced, convolved).
  88. timingApplePAL_ST                EQU        238                    ;  640x480 (50 Hz, interlaced, non-convolved).
  89. timingApplePAL_FF                EQU        240                    ;  768x576 (50 Hz, interlaced, non-convolved).
  90. timingApplePAL_STconv            EQU        242                    ;  640x480 (50 Hz, interlaced, non-convolved).
  91. timingApplePAL_FFconv            EQU        244                    ;  768x576 (50 Hz, interlaced, non-convolved).
  92.  
  93. ; csConnectFlags values in VDDisplayConnectInfo 
  94. kAllModesValid                    EQU        0                    ; All modes not trimmed by primary init are good close enough to try 
  95. kAllModesSafe                    EQU        1                    ; All modes not trimmed by primary init are know to be safe 
  96. kReportsTagging                    EQU        2                    ; Can detect tagged displays (to identify smart monitors) 
  97. kHasDirectConnection            EQU        3                    ; True implies that driver can talk directly to device (e.g. serial data link via sense lines) 
  98. kIsMonoDev                        EQU        4                    ; Says whether there’s an RGB (0) or Monochrome (1) connection. 
  99. kUncertainConnection            EQU        5                    ; There may not be a display (no sense lines?). 
  100. kReservedConnectionBit            EQU        6                    ; Reserved for now 
  101. kReportsDDCConnection            EQU        7                    ; Card can do ddc (set kHasDirectConnect && kHasDDCConnect if you actually found a ddc display). 
  102. kHasDDCConnection                EQU        8                    ; Card has ddc connect now. 
  103.  
  104. ; csDisplayType values in VDDisplayConnectInfo 
  105. kUnknownConnect                    EQU        1                    ; Not sure how we’ll use this, but seems like a good idea. 
  106. kPanelConnect                    EQU        2                    ; For use with fixed-in-place LCD panels. 
  107. kPanelTFTConnect                EQU        2                    ; Alias for kPanelConnect 
  108. kFixedModeCRTConnect            EQU        3                    ;  For use with fixed-mode (i.e., very limited range) displays. 
  109. kMultiModeCRT1Connect            EQU        4                    ; 320x200 maybe, 12" maybe, 13" (default), 16" certain, 19" maybe, 21" maybe 
  110. kMultiModeCRT2Connect            EQU        5                    ; 320x200 maybe, 12" maybe, 13" certain, 16" (default), 19" certain, 21" maybe 
  111. kMultiModeCRT3Connect            EQU        6                    ; 320x200 maybe, 12" maybe, 13" certain, 16" certain, 19" default, 21" certain 
  112. kMultiModeCRT4Connect            EQU        7                    ; Expansion to large multi mode (not yet used) 
  113. kModelessConnect                EQU        8                    ; Expansion to modeless model (not yet used) 
  114. kFullPageConnect                EQU        9                    ; 640x818 (to get 8bpp in 512K case) and 640x870 (these two only) 
  115. kVGAConnect                        EQU        10                    ; 640x480 VGA default -- question everything else 
  116. kNTSCConnect                    EQU        11                    ; NTSC ST (default), FF, STconv, FFconv 
  117. kPALConnect                        EQU        12                    ; PAL ST (default), FF, STconv, FFconv 
  118. kHRConnect                        EQU        13                    ; 640x400 (to get 8bpp in 256K case) and 640x480 (these two only) 
  119. kPanelFSTNConnect                EQU        14                    ; For use with fixed-in-place LCD FSTN (aka “Supertwist”) panels 
  120.  
  121. ; csTimingFlags values in VDTimingInfoRec 
  122. kModeValid                        EQU        0                    ; Says that this mode should NOT be trimmed. 
  123. kModeSafe                        EQU        1                    ; This mode does not need confirmation 
  124. kModeDefault                    EQU        2                    ; This is the default mode for this type of connection 
  125. kModeShowNow                    EQU        3                    ; This mode should always be shown (even though it may require a confirm) 
  126. kModeNotResize                    EQU        4                    ; This mode should not be used to resize the display (eg. mode selects a different connector on card) 
  127.  
  128. ; Control Codes 
  129. cscReset                        EQU        0
  130. cscKillIO                        EQU        1
  131. cscSetMode                        EQU        2
  132. cscSetEntries                    EQU        3
  133. cscSetGamma                        EQU        4
  134. cscGrayPage                        EQU        5
  135. cscGrayScreen                    EQU        5
  136. cscSetGray                        EQU        6
  137. cscSetInterrupt                    EQU        7
  138. cscDirectSetEntries                EQU        8
  139. cscSetDefaultMode                EQU        9
  140. cscSwitchMode                    EQU        10
  141. cscSetSync                        EQU        11
  142. cscSavePreferredConfiguration    EQU        16
  143.  
  144. ; Status Codes 
  145. cscGetMode                        EQU        2
  146. cscGetEntries                    EQU        3
  147. cscGetPageCnt                    EQU        4
  148. cscGetPages                        EQU        4                    ; This is what C&D 2 calls it. 
  149. cscGetPageBase                    EQU        5
  150. cscGetBaseAddr                    EQU        5                    ; This is what C&D 2 calls it. 
  151. cscGetGray                        EQU        6
  152. cscGetInterrupt                    EQU        7
  153. cscGetGamma                        EQU        8
  154. cscGetDefaultMode                EQU        9
  155. cscGetCurMode                    EQU        10
  156. cscGetSync                        EQU        11
  157. cscGetConnection                EQU        12                    ; Return information about the connection to the display 
  158. cscGetModeTiming                EQU        13                    ; Return timing info for a mode 
  159. cscGetModeBaseAddress            EQU        14                    ; Return base address information about a particular mode 
  160. cscGetScanProc                    EQU        15                    ; QuickTime scan chasing routine 
  161. cscGetPreferredConfiguration    EQU        16
  162. cscGetNextResolution            EQU        17
  163. cscGetVideoParameters            EQU        18
  164. cscGetGammaList                    EQU        19
  165.  
  166. ; Bit definitions for the Get/Set Sync call
  167. kHorizontalSyncDisableBit        EQU        0
  168. kVerticalSyncDisableBit            EQU        1
  169. kCompositeSyncDisableBit        EQU        2
  170. kSyncOnRedEnableBit                EQU        3
  171. kSyncOnGreenEnableBit            EQU        4
  172. kSyncOnBlueEnableBit            EQU        5
  173. kHorizontalSyncMask                EQU        $01
  174. kVerticalSyncMask                EQU        $02
  175. kCompositeSyncMask                EQU        $04
  176. kDPMSSyncMask                    EQU        $7
  177. kSyncOnRedMask                    EQU        $08
  178. kSyncOnGreenMask                EQU        $10
  179. kSyncOnBlueMask                    EQU        $20
  180. kSyncOnMask                        EQU        $38
  181.  
  182. VPBlock                 RECORD    0
  183. vpBaseOffset             ds.l    1                                    ;Offset to page zero of video RAM (From minorBaseOS).
  184. vpRowBytes                 ds.w    1                                    ;Width of each row of video memory.
  185. vpBounds                 ds        Rect                                ;BoundsRect for the video display (gives dimensions).
  186. vpVersion                 ds.w    1                                    ;PixelMap version number.
  187. vpPackType                 ds.w    1
  188. vpPackSize                 ds.l    1
  189. vpHRes                     ds.l    1                                    ;Horizontal resolution of the device (pixels per inch).
  190. vpVRes                     ds.l    1                                    ;Vertical resolution of the device (pixels per inch).
  191. vpPixelType                 ds.w    1                                    ;Defines the pixel type.
  192. vpPixelSize                 ds.w    1                                    ;Number of bits in pixel.
  193. vpCmpCount                 ds.w    1                                    ;Number of components in pixel.
  194. vpCmpSize                 ds.w    1                                    ;Number of bits per component
  195. vpPlaneBytes             ds.l    1                                    ;Offset from one plane to the next.
  196. sizeof                     EQU    42
  197.                         ENDR
  198.  
  199. VDEntryRecord             RECORD    0
  200. csTable                     ds.l    1                                    ;(long) pointer to color table entry=value, r,g,b:INTEGER
  201. sizeof                     EQU    4
  202.                         ENDR
  203.  
  204. ; Parm block for SetGray control call 
  205. VDGrayRecord             RECORD    0
  206. csMode                     ds.b    1                                    ;Same as GDDevType value (0=mono, 1=color)
  207. filler                     ds.b    1
  208. sizeof                     EQU    2
  209.                         ENDR
  210.  
  211. ; Parm block for SetEntries control call 
  212. VDSetEntryRecord         RECORD    0
  213. csTable                     ds.l    1                                    ;Pointer to an array of color specs
  214. csStart                     ds.w    1                                    ;Which spec in array to start with, or -1
  215. csCount                     ds.w    1                                    ;Number of color spec entries to set
  216. sizeof                     EQU    8
  217.                         ENDR
  218.  
  219. ; Parm block for SetGamma control call 
  220. VDGammaRecord             RECORD    0
  221. csGTable                 ds.l    1                                    ;pointer to gamma table
  222. sizeof                     EQU    4
  223.                         ENDR
  224.  
  225. VDSwitchInfoRec         RECORD    0
  226. csMode                     ds.w    1                                    ;(word) mode depth
  227. csData                     ds.l    1                                    ;(long) functional sResource of mode
  228. csPage                     ds.w    1                                    ;(word) page to switch in
  229. csBaseAddr                 ds.l    1                                    ;(long) base address of page (return value)
  230. csReserved                 ds.l    1                                    ;(long) Reserved (set to 0) 
  231. sizeof                     EQU    16
  232.                         ENDR
  233.  
  234. VDTimingInfoRec         RECORD    0
  235. csTimingMode             ds.l    1                                    ; LONGINT - (long) timing mode (a la InitGDevice) 
  236. csTimingReserved         ds.l    1                                    ; LONGINT - (long) reserved 
  237. csTimingFormat             ds.l    1                                    ; LONGINT - (long) what format is the timing info 
  238. csTimingData             ds.l    1                                    ; LONGINT - (long) data supplied by driver 
  239. csTimingFlags             ds.l    1                                    ; LONGINT - (long) mode within device 
  240. sizeof                     EQU    20
  241.                         ENDR
  242.  
  243. VDDisplayConnectInfoRec RECORD    0
  244. csDisplayType             ds.w    1                                    ; INTEGER - (word) Type of display connected 
  245. csConnectTagged             ds.w    1                                    ; INTEGER - (word) Display is currently "it" (tagged to identify component) 
  246. csConnectFlags             ds.l    1                                    ; LONGINT - (long) tell us about the connection 
  247. csDisplayComponent         ds.l    1                                    ; LONGINT - (long) if the card has a direct connection to the display, it returns the display component here (FUTURE) 
  248. csConnectReserved         ds.l    1                                    ; LONGINT - (long) reserved 
  249. sizeof                     EQU    16
  250.                         ENDR
  251.  
  252. VDPageInfo                 RECORD    0
  253. csMode                     ds.w    1                                    ;(word) mode within device
  254. csData                     ds.l    1                                    ;(long) data supplied by driver
  255. csPage                     ds.w    1                                    ;(word) page to switch in
  256. csBaseAddr                 ds.l    1                                    ;(long) base address of page
  257. sizeof                     EQU    12
  258.                         ENDR
  259.  
  260. VDSizeInfo                 RECORD    0
  261. csHSize                     ds.w    1                                    ;(word) desired/returned h size
  262. csHPos                     ds.w    1                                    ;(word) desired/returned h position
  263. csVSize                     ds.w    1                                    ;(word) desired/returned v size
  264. csVPos                     ds.w    1                                    ;(word) desired/returned v position
  265. sizeof                     EQU    8
  266.                         ENDR
  267.  
  268. VDSettings                 RECORD    0
  269. csParamCnt                 ds.w    1                                    ;(word) number of params
  270. csBrightMax                 ds.w    1                                    ;(word) max brightness
  271. csBrightDef                 ds.w    1                                    ;(word) default brightness
  272. csBrightVal                 ds.w    1                                    ;(word) current brightness
  273. csCntrstMax                 ds.w    1                                    ;(word) max contrast
  274. csCntrstDef                 ds.w    1                                    ;(word) default contrast
  275. csCntrstVal                 ds.w    1                                    ;(word) current contrast
  276. csTintMax                 ds.w    1                                    ;(word) max tint
  277. csTintDef                 ds.w    1                                    ;(word) default tint
  278. csTintVal                 ds.w    1                                    ;(word) current tint
  279. csHueMax                 ds.w    1                                    ;(word) max hue
  280. csHueDef                 ds.w    1                                    ;(word) default hue
  281. csHueVal                 ds.w    1                                    ;(word) current hue
  282. csHorizDef                 ds.w    1                                    ;(word) default horizontal
  283. csHorizVal                 ds.w    1                                    ;(word) current horizontal
  284. csHorizMax                 ds.w    1                                    ;(word) max horizontal
  285. csVertDef                 ds.w    1                                    ;(word) default vertical
  286. csVertVal                 ds.w    1                                    ;(word) current vertical
  287. csVertMax                 ds.w    1                                    ;(word) max vertical
  288. sizeof                     EQU    38
  289.                         ENDR
  290.  
  291.  
  292. kFirstDepthMode                    EQU        128
  293. kSecondDepthMode                EQU        129
  294. kThirdDepthMode                    EQU        130
  295. kFourthDepthMode                EQU        131
  296. kFifthDepthMode                    EQU        132
  297. kSixthDepthMode                    EQU        133
  298.  
  299. VDResolutionInfoRec     RECORD    0
  300. csPreviousDisplayModeID     ds.l    1                                    ; ID of the previous resolution in a chain 
  301. csDisplayModeID             ds.l    1                                    ; ID of the next resolution 
  302. csHorizontalPixels         ds.l    1                                    ; # of pixels in a horizontal line 
  303. csVerticalLines             ds.l    1                                    ; # of lines in a screen 
  304. csRefreshRate             ds.l    1                                    ; Vertical Refresh Rate in Hz 
  305. csMaxDepthMode             ds.w    1                                    ; 0x80-based number representing max bit depth 
  306. csReserved                 ds.l    1                                    ; Reserved 
  307. csReserved1                 ds.l    1                                    ; Reserved 
  308. sizeof                     EQU    30
  309.                         ENDR
  310.  
  311. VDVideoParametersInfoRec RECORD    0
  312. csDisplayModeID             ds.l    1                                    ; the ID of the resolution we want info on 
  313. csDepthMode                 ds.w    1                                    ; The bit depth we want the info on (0x80 based) 
  314. csVPBlockPtr             ds.l    1                                    ; Pointer to a video parameter block 
  315. csPageCount                 ds.l    1                                    ; Number of pages supported by the resolution 
  316. csDeviceType             ds.l    1                                    ; Device Type:  Direct, Fixed or CLUT; 
  317. csReserved                 ds.l    1                                    ; Reserved 
  318. sizeof                     EQU    22
  319.                         ENDR
  320.  
  321. VDGammaInfoRec             RECORD    0
  322. csLastGammaID             ds.l    1                                    ; the ID of the previous gamma table 
  323. csNextGammaID             ds.l    1                                    ; the ID of the next gamma table 
  324. csGammaPtr                 ds.l    1                                    ; Ptr to a gamma table data 
  325. csReserved                 ds.l    1                                    ; Reserved 
  326. sizeof                     EQU    16
  327.                         ENDR
  328.  
  329. VDDefMode                 RECORD    0
  330. csID                     ds.b    1
  331. filler1                     ds.b    1
  332. sizeof                     EQU    2
  333.                         ENDR
  334.  
  335. VDSyncInfoRec             RECORD    0
  336. csMode                     ds.b    1
  337. csFlags                     ds.b    1
  338. sizeof                     EQU    2
  339.                         ENDR
  340.  
  341.     ENDIF ; __VIDEO__
  342.